﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace SpriteWithXNA
{
    public class MyBackGround: MySprite
    {
         public MyBackGround(Texture2D[] _inputtexture2d, float _inputx, float _inputy)
        {
            texture2d = _inputtexture2d;
            x = _inputx;
            y = _inputy;
            itexture2d = 0;
            ngameTime = 0;
        }

         public override void Update(GameTime gameTime)
         {
             ngameTime++;
             if (ngameTime == 100)
             {
                 //Random r = new Random();
                 //x = x + r.Next(7) - 3;
                 //y = y + r.Next(11) - 5;
                 _itexture2d = (_itexture2d + 1) % ntexture2d;
                 ngameTime = 0;
             }
         }
    }
}
